package cn.hnucm.vo;

import cn.hnucm.bean.TbGoodsBasis;
import cn.hnucm.bean.TbGoodsOrder;
import cn.hnucm.bean.TbUserBasis;
import lombok.Data;

/**
 * @Author:liweihua
 * @Description: 支付成功时返回给前端的订单实体类
 * @Date: 10:59$ 2021/12/29/029$
 * @Modified:
 */
@Data
public class ReturnOrderInfo {

    public void initReturnOrderInfo(TbGoodsOrder order, TbUserBasis tbUserBasis, TbGoodsBasis tbGoodsBasis){
        this.orderId  = order.getOrderId();
        this.tbGoodsBasis = tbGoodsBasis;
        this.userAsset = tbUserBasis.getUserAsset();
        this.userUsername = tbUserBasis.getUserUsername();
        this.orderState = order.getOrderState();
        this.orderInvoleValue  = order.getOrderInvoleValue();
        this.orderStartDatetime = order.getOrderStartDatetime();
        this.orderEndDatetime = "none";
    }
    //    @ApiModelProperty(value = "订单编号")
//    @TableId(value = "orderId", type = IdType.AUTO)
    private Integer orderId;

    private TbGoodsBasis tbGoodsBasis;

    private String msg;
    /**
     * 用户余额
     */
    private Float userAsset;

    /**
     * 用户名称
     */
    private String userUsername;

    //    @ApiModelProperty(value = "订单状态 1:未付款 2:已付款 3:已送达 4:已接收(结束)")
//    @TableField("orderState")
    private Integer orderState;

    //    @ApiModelProperty(value = "订单设计金额")
//    @TableField("orderInvoleValue")
    private Float orderInvoleValue;

    //    @ApiModelProperty(value = "订单开始时间")
//    @TableField("orderStartDatetime")
    private String orderStartDatetime;

//    @ApiModelProperty(value = "订单结束时间")
//    @TableField("orderEndDatetime")
    private String orderEndDatetime;
}
